﻿<Window x:Class="CodeSample.InsertUpdateWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Sample" 
        Height="600" 
        Width="600" 
        MinHeight="440" 
        MinWidth="410"
        FontFamily="Lucida Sans Unicode"
        Closing="Window_Closing" 
        KeyDown="Window_KeyDown"
        Icon="/Code Sample;component/Images/simple%20samples2.png">
    <Window.Resources>
        <Style TargetType="Label">
            <Setter Property="FontFamily" 
                    Value="Lucida Sans Unicode">
            </Setter>
            <Setter Property="HorizontalAlignment" 
                    Value="Right">
            </Setter>
            <Setter Property="Margin" 
                    Value="5">
            </Setter>
        </Style>
        <Style TargetType="TextBox">
            <Setter Property="FontFamily" 
                    Value="Lucida Sans Unicode">
            </Setter>
            <Setter Property="TextWrapping" 
                    Value="Wrap">
            </Setter>
        </Style>
    </Window.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="125"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" 
                           MinHeight="28">
            </RowDefinition>
            <RowDefinition Height="Auto" 
                           MinHeight="28">
            </RowDefinition>
            <RowDefinition Height="*" >
            </RowDefinition>
            <RowDefinition Height="Auto" 
                           SharedSizeGroup="row3">
            </RowDefinition>
            <RowDefinition Height="Auto" 
                           SharedSizeGroup="row4">
            </RowDefinition>
            <RowDefinition Height="Auto" 
                           MinHeight="28">
            </RowDefinition>
            <RowDefinition Height="Auto" 
                           MinHeight="28">
            </RowDefinition>
        </Grid.RowDefinitions>
        
        <Label Grid.Row="0" 
               Name="lblLanguage">
            Language:
        </Label>
        <Label Grid.Row="1" 
               Name="lblName">
            Code Name:
        </Label>
        <StackPanel Grid.Row="2" 
                    Name="stkpnlCode">
            <Label Name="lblCode">
                Code:
            </Label>
            <Button Name="btnFormat" 
                    Margin="5" 
                    HorizontalAlignment="Right" 
                    Padding="5" 
                    IsEnabled="False" 
                    Click="btnFormat_Click">
                Format Selection
            </Button>
            <Label Foreground="Chocolate" 
                   Margin="0, 0, 5, 0">
                Remove leading
            </Label>
            <Label Foreground="Chocolate" 
                   Margin="0, 0, 5, 0">
                redundant space
            </Label>
            <Label Foreground="Chocolate" 
                   Margin="0, 0, 5, 0">
                of selected code
            </Label>
        </StackPanel>
        <Label Grid.Row="3" 
               Name="lblPurpose">
            What Code Do:
        </Label>
        <StackPanel Grid.Row="4">
            <Label Name="lblDetails" 
                   Margin="0, 5, 5, 0">
                More Details:
            </Label>
            <Label Foreground="Chocolate" 
                   Margin="0, 0, 5, 0">
                (Optional)
            </Label>
        </StackPanel>
        <Label Grid.Row="5" >
            Author:
        </Label>

        <StackPanel Grid.Column="1" 
                    Grid.Row="0" 
                    Orientation="Horizontal">
            <TextBox Name="txtLanguage" 
                     Margin="5" 
                     Width="100" 
                     TabIndex="0">
            </TextBox>
            <Label Foreground="Chocolate">
                Ex: Java, C#, C++,...
            </Label>
        </StackPanel>
        <TextBox Grid.Column="1" 
                 Grid.Row="1" 
                 Name="txtName"
                 Margin="5" 
                 TabIndex="1">
        </TextBox>
        <TextBox Grid.Column="1" 
                 Grid.Row="3" 
                 Name="txtPurpose" 
                 AcceptsReturn="True" 
                 VerticalScrollBarVisibility="Auto"
                 Margin="5" 
                 TabIndex="3">
        </TextBox>

        <GridSplitter Grid.Column="1"
                      Grid.Row="3"
                      HorizontalAlignment="Stretch"
                      VerticalAlignment="Top"
                      Height="5"
                      Background="Transparent">
        </GridSplitter>
        
        <TextBox Grid.Column="1" 
                 Grid.Row="4"
                 Name="txtDetails" 
                 AcceptsReturn="True" 
                 VerticalScrollBarVisibility="Auto"
                 Margin="5" 
                 TabIndex="4">
        </TextBox>

        <GridSplitter Grid.Column="1"
                      Grid.Row="4"
                      HorizontalAlignment="Stretch"
                      VerticalAlignment="Top"
                      Height="5"
                      Background="Transparent">
        </GridSplitter>
        
        <StackPanel Grid.Column="1" 
                    Grid.Row="5" 
                    Orientation="Horizontal">
            <TextBox Name="txtAuthor" 
                     Margin="5" 
                     Width="100" 
                     TabIndex="5">
            </TextBox>
            <Label Foreground="Chocolate">
                Ex: Internet, HiệpHN,...
            </Label>
        </StackPanel>
        
        <RichTextBox Grid.Column="1" 
                     Grid.Row="2" 
                     Name="rchtxtCode" 
                     AcceptsReturn="True" 
                     AcceptsTab="True"
                     Margin="5" 
                     VerticalScrollBarVisibility="Auto" 
                     SelectionChanged="rchtxtCode_SelectionChanged" 
                     TabIndex="2" 
                     FontFamily="Consolas" >
        </RichTextBox>

        <Button Grid.Column="1" 
                Grid.Row="6" 
                Margin="5" 
                Width="100" 
                HorizontalAlignment="Left" 
                Click="Button_Click" 
                TabIndex="6">
            OK
        </Button>
        
    </Grid>
</Window>
